<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;

//前台页面模块路由
Route::rule("/","index/index/index");

//用户模块
Route::rule("/login","index/user/login");
Route::rule("/register","index/user/register");
Route::rule("/register-success","index/user/registerSuccess");

//生成验证码的路由
//Route::rule("/verifycode/:option","index/VerifyCode/:option");
Route::rule("/verifycode","index/VerifyCode/getCode");
//Route::rule("/verifycode/checkCode","index/VerifyCode/checkCode");

//试用模块
Route::rule("/trial","index/trial/index");

//商品模块
Route::rule("/new","index/goods/newGoods");



//前台数据接口模块路由
Route::group("api",function(){
    Route::rule("/v1/:controller/:option","api/v1.:controller/:option");
    Route::rule("/error","api/common.Error/NotFound");
    //miss 路由 所有的错误提示处理
    Route::miss("/api/error");
});

//前台数据接口模块路由
Route::group("wechat",function(){
    Route::rule("/v1/:controller/:option","wechat/v1.:controller/:option");
});

//配置一个错误提示路由
Route::rule("/error","index/common.Error/notfound");
Route::miss("/error");
